import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import MemberManagement from '../views/MemberManagement.vue'
import ProjectManagement from '../views/ProjectManagement.vue'
import PDFConfirmation from '../views/PDFConfirmation.vue'
import WorkloadCalculation from '../views/WorkloadCalculation.vue'
import ComprehensiveCalculation from '../views/ComprehensiveCalculation.vue'
import ReportManagement from '../views/ReportManagement.vue'
import ReportReview from '../views/ReportReview.vue'
import Dashboard from '../views/Dashboard.vue'
import ReportExport from '../views/ReportExport.vue'
import Visualization from '../views/Visualization.vue'
import PersonalInfo from '../views/PersonalInfo.vue'
import Login from '../views/Login.vue'
import MainLayout from '../components/MainLayout.vue'
import ProjectDetails from '../views/ProjectDetails.vue'
import ReportReviewDetail from '../views/ReportReviewDetail.vue'

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login,
    meta: { title: '登录' }
  },
  {
    path: '/main',
    component: MainLayout,
    children: [
      { path: '', redirect: '/main/home' },
      { path: 'home', name: 'Home', component: Home, meta: { title: '首页' } },
      { path: 'member-management', name: 'MemberManagement', component: MemberManagement, meta: { title: '成员管理' } },
      { path: 'project-management', name: 'ProjectManagement', component: ProjectManagement, meta: { title: '项目管理' } },
      { path: 'pdf-confirmation', name: 'PDFConfirmation', component: PDFConfirmation, meta: { title: '确定PDF' } },
      { path: 'workload-calculation', name: 'WorkloadCalculation', component: WorkloadCalculation, meta: { title: '计算工作量' } },
      { path: 'comprehensive-calculation', name: 'ComprehensiveCalculation', component: ComprehensiveCalculation, meta: { title: '综合计算' } },
      { path: 'report-management', name: 'ReportManagement', component: ReportManagement, meta: { title: '报告管理' } },
      { path: 'report-review', name: 'ReportReview', component: ReportReview, meta: { title: '报告审核' } },
      { path: 'dashboard', name: 'Dashboard', component: Dashboard, meta: { title: '数据看板' } },
      { path: 'report-export', name: 'ReportExport', component: ReportExport, meta: { title: '报告导出' } },
      { path: 'visualization', name: 'Visualization', component: Visualization, meta: { title: '可视化' } },
      { path: 'personal-info', name: 'PersonalInfo', component: PersonalInfo, meta: { title: '个人信息' } },
      {path: '/project-details/:projectId', name: 'ProjectDetails',component: ProjectDetails,meta: { title: '项目详情' } },
      { path: 'report-review-detail/:reportId', name: 'ReportReviewDetail', component: ReportReviewDetail, meta: { title: '报告审核详情' } },

    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router